{% extends "base.html" %}

{% block body %}

<h2>Prototypes by {{ user }}</h2>

{% if prototypes %}
  <ol>
    {% for prototype in prototypes %}
      <li>
        <div>
          <a href="/{{ prototype.key.id}}">{% spaceless %}
            <strong>
            {% if prototype.title %}
              {{ prototype.title }}
            {% else %}
              {{ prototype.key.id }}
            {% endif %}
            </strong>
          {% endspaceless %}</a>

        </div>
        <small>
          <div>created {{ prototype.created }}</div>
          <div>modified {{ prototype.modified }}</div>
          {% if prototype.fork_from %}
            <div>
              fork of
              <a href="/{{ prototype.fork_from.key }}"
                >{{ prototype.fork_from.title }}</a>
            </div>
          {% endif %}
          <div>
            <form action="/delete/{{ prototype.key.id}}" method="post"
              onsubmit="return confirm('Are you sure?');">
              <input type="hidden" name="continue" value="/mine">
              <button type="submit"
                style="color:red">Delete</button>
            </form>
          </div>
        </small>
      </li>
    {% endfor %}
  </ol>
{% else %}
  <img src="https://memegen.googleplex.com/memeimage?k=640184">
{% endif %}

{% endblock %}
